import type { Component, App } from "vue";

// 组件引入
import SvgIcon from "@/components/svg-icon/index.vue";
import VirtualList from "@/components/virtual-list/src/index.vue";
import TitanEmpty from "@/components/empty/index.vue";
import TitanCharts from "@/components/charts/src";
import HighLight from "@/components/high-light/src";
import TitanFlag from "@/components/flag/src/index.vue";
import TitanCard from "@/components/card/src/index.vue";
import PhotoGallery from "@/components/photo-gallery/src/index.vue";
import TitanTranslate from "@/components/translate/src/index.vue";
import TitanTweet from "@/components/tweet/src/index.vue";
import TitanInfoLine from "@/components/info-line/src";
import TitanForm from "@/components/form/src";
import TitanTagPopover from "@/components/tag-popover/src";

const components: { [propName: string]: Component } = {
  SvgIcon,
  VirtualList,
  TitanEmpty,
  TitanCharts,
  HighLight,
  TitanFlag,
  TitanCard,
  PhotoGallery,
  TitanTranslate,
  TitanTweet,
  TitanInfoLine,
  TitanForm,
  TitanTagPopover,
};

export default {
  install: (Vue: App) => {
    for (const key in components) {
      Vue.component(key, components[key]);
    }
  },
};
